home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / CSMP Digest / volume 1 / csmp-v1-193.txt < prev    next >
Encoding:
Text File  |  1992-12-31  |  48.5 KB  |  1,288 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Tue, 20 Oct 92       Volume 1 : Issue 193
  2.  
  3. Today's Topics:
  4.  
  5.     MacsBug symbols from assembler code?
  6.     # of files
  7.     more on sublaunching
  8.     animating palettes
  9.  
  10.  
  11.  
  12. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  13.  
  14. The digest is a collection of article threads from the internet newsgroup
  15. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  16. regularly and want an archive of the discussions.  If you don't know what a
  17. newsgroup is, you probably don't have access to it.  Ask your systems
  18. administrator(s) for details.  (This means you can't post questions to the
  19. digest.)
  20.  
  21. Each issue of the digest contains one or more sets of articles (called
  22. threads), with each set corresponding to a 'discussion' of a particular
  23. subject.  The articles are not edited; all articles included in this digest
  24. are in their original posted form (as received by our news server at
  25. cs.uoregon.edu).  Article threads are not added to the digest until the last
  26. article added to the thread is at least one month old (this is to ensure that
  27. the thread is dead before adding it to the digest).  Article threads that
  28. consist of only one message are generally not included in the digest.
  29.  
  30. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  31. [128.223.8.8] in the directory /pub/mac/csmp-digest.  Be sure to read the
  32. file /pub/mac/csmp-digest/README before downloading any files.  The most
  33. recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
  34. directory /info-mac/digest/csmp.  If you don't have ftp capability, the sumex
  35. archive has a mail server; send a message with the text '$MACarch help' (no
  36. quotes) to LISTSERV@ricevm1.rice.edu for more information.
  37.  
  38. The digest is also available via email.  Just send a note saying that you
  39. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  40. automatically receive each new issue as it is created.  Sorry, back issues
  41. are not available through the mailing list.
  42.  
  43. Send administrative mail to mkelly@cs.uoregon.edu.
  44.  
  45.  
  46. -------------------------------------------------------
  47.  
  48. From: datpete@daimi.aau.dk (Peter Andersen)
  49. Subject: MacsBug symbols from assembler code?
  50. Date: 20 Aug 92 15:57:33 GMT
  51. Organization: DAIMI: Computer Science Department, Aarhus University, Denmark
  52.  
  53. How do I make a (global) symbol known to MacsBug?
  54. I have tried adding 
  55.  
  56.    DC.B $8C, 'MySymbol'
  57.    DC.W $0000
  58.  
  59. after the last RTS in the code of the procedure, as described in
  60. the MacsBug manual (Appendix G, p.118, MacsBug version 6.1 manual),
  61. but the symbol is not known to MacsBug, when I try to debug the code.
  62.  
  63. I am using MPW 3.2.2, System 7.0.1 (US), MacsBug version 6.2b2 on a 
  64. Macintosh IIx.
  65.  
  66. I have also tried {MPW}:Examples:AExamples:Sample.a, but although it
  67. tries to add MacsBug symbols with the macro BdgInfo, again these symbols
  68. are not known to my MacsBug.
  69.  
  70. Am I missing something?
  71.  
  72. Peter Andersen, e-mail: datpete@daimi.aau.dk
  73.  
  74. +++++++++++++++++++++++++++
  75.  
  76. From: quinn@cs.uwa.edu.au (Quinn)
  77. Date: 21 Aug 92 03:09:41 GMT
  78. Organization: The University of Western Australia
  79.  
  80. In article <1992Aug20.155733.6869@daimi.aau.dk> Peter Andersen,
  81. datpete@daimi.aau.dk writes:
  82. >Am I missing something?
  83.  
  84. Hmm.  I had great fun getting MacsBug symbols working consistently
  85. in my latest Asm project.  Try using the following macro (with
  86. apologies to those people whose systems don't expand tabs
  87. properly)...
  88.  
  89. - ----------------------------------------------
  90.     macro
  91.     MacsBug    &Name,&rts:int
  92.     lclc    &oldstr
  93.     gbla    &debug
  94.  
  95.     if &debug then
  96.     
  97.     if &rts then 
  98.     rts                ; force rts in specific cases
  99.     endif
  100.     
  101.     dc.b    &len(&name)+$80        ; length of string + $80 marks symbol
  102. &oldstr    setc    &setting('string')
  103.     string    AsIs
  104.     dc.b    '&upcase(&Name)'    ; define the string AsIs
  105.     string    &oldstr
  106.     align                ; pad to word boundary
  107.     dc.w    0            ; no literals
  108.     
  109.     endif
  110.     
  111.     endm
  112. - ----------------------------------------------
  113.  
  114. ... which you invoke as.
  115.         MacsBug         Fred
  116.         MacsBug         Jim,1
  117. at the end of routine Fred that ends in an RTS (or JMP (A0) or
  118. RTD) or routine Jim that doesn't end in one of the above.
  119.  
  120. However theres still the problem of whether MacsBug will actually
  121. see the symbol.  Sometimes it does, sometimes it doesn't.  I'm not
  122. actually sure what it depends on but I think it has something to do
  123. with what code has been executed recently.  One thing that I found
  124. that helps is doing an 'hx' into the heap that the symbol is in.
  125. But if all else fails you can at least search for the symbol string
  126. (-:
  127.  
  128. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  129. Department of Computer Science, The University of Western Australia
  130.   -- MacsBug:  Don't leave home without it.
  131.   -- This macro is for Pascal; converting it to C is left as an
  132.      exercise to the reader.  (-:
  133.  
  134. +++++++++++++++++++++++++++
  135.  
  136. From: creiman@Apple.COM (Charlie Reiman)
  137. Date: 21 Aug 92 17:19:11 GMT
  138. Organization: Apple Computer Inc., Cupertino, CA
  139.  
  140. quinn@cs.uwa.edu.au (Quinn) writes:
  141.  
  142. >In article <1992Aug20.155733.6869@daimi.aau.dk> Peter Andersen,
  143. >datpete@daimi.aau.dk writes:
  144. >>Am I missing something?
  145.  
  146. >Hmm.  I had great fun getting MacsBug symbols working consistently
  147. >in my latest Asm project.  Try using the following macro (with
  148. >apologies to those people whose systems don't expand tabs
  149. >properly)...
  150.  
  151. >----------------------------------------------
  152. >    macro
  153. >    MacsBug    &Name,&rts:int
  154. >    lclc    &oldstr
  155. >    gbla    &debug
  156.  
  157. >    if &debug then
  158. >    
  159. >    if &rts then 
  160. >    rts                ; force rts in specific cases
  161. >    endif
  162. >    
  163. >    dc.b    &len(&name)+$80        ; length of string + $80 marks symbol
  164. >&oldstr    setc    &setting('string')
  165. >    string    AsIs
  166. >    dc.b    '&upcase(&Name)'    ; define the string AsIs
  167. >    string    &oldstr
  168. >    align                ; pad to word boundary
  169. >    dc.w    0            ; no literals
  170. >    
  171. >    endif
  172. >    
  173. >    endm
  174.  
  175. This is almost correct :-) If you have the Macsbug manual, the definition
  176. of a procedure is on p. 408. Follow the bouncing ball if you have a copy,
  177. otherwise just mumble through the quote below.
  178.  
  179. Begin quote:
  180.  
  181. A procedure is defined as follows:
  182.  o LINK A6 - This instruction is optional; if it is missing, the start
  183.    of the proche procedure is assumed to be immediately after the preceding
  184.    procedure, or at the start of the heap block. 
  185.  o Procedure code
  186.  o RTS or JMP (a0) or RTD
  187.  o Procedure name
  188.  o Procedcure constants
  189.  
  190. End quote.
  191.  
  192. So the most likely reason you aren't always seeing your symbols is because
  193. you don't have LINK/UNLK pairs. (I usually don't use them since most asm
  194. code I write is just glue. Stack frames are overkill for me. I'm making
  195. the assumption you don't use them much either.)
  196.  
  197. Second problem: You macro only covers one of the 4 styles of symbols.
  198. To paraphrase The Book:
  199.  
  200. Valid symbol characters: [a-zA-Z0-9_%. ] Space is only allowed to pad out
  201. fixed length symbols
  202.  
  203. 8  character names: First byte is $20-$7f or $a0-$ff. If the high bit is
  204. set, ignore it. The next character must have its high bit clear.
  205.  
  206. 16 character names: First byte is $20-$7f or $a0-$ff, as for 8 byte
  207. symbols. The second byte will have its high bit set, however. This symbol
  208. style is used for Object Pascal. The first 8 bytes are the method, the
  209. second 8 the class.
  210.  
  211. Still with me? Good. Now we get to the styles you probably want to use:
  212.  
  213. Short variable length symbol: First byte is $81-$9F. This is the length
  214. with the high bit set. This is immediately followed by the name itself.
  215.  
  216. Long variable length symbol: First byte is $80, followed by a length byte,
  217. followed by the actual name.
  218.  
  219. For both variable length symbols, its a good idea to place the constant
  220. data marker after the symbol. The Book sez: "The first word after the
  221. name specified how many bytes of constant data are present. If there
  222. are no  constants, a length of 0 must be given."
  223.  
  224. In short, a good symbol would be defined like this:
  225.  
  226. MyFunkyProc   PROC
  227.           link a6,#0
  228.           unlk a6
  229.           rts
  230.           dc.b 11+128,'MyFunkyProc'
  231.           dc.w 0000
  232.           ENDP
  233.  
  234. You might be able to use only the long variable length style in your macro
  235. to make life easier on yourself. I haven't tried this but its worth a shot.
  236.  
  237. Have f
  238. Bus Err while trying to execute from $50FFC001.
  239.  
  240.  
  241. - -- 
  242. Charlie Reiman - Speaking as an individual, not for Apple Computer.
  243. creiman@apple.com
  244.         "NEW! Posting Lite! 98% fact free!"
  245.  
  246. +++++++++++++++++++++++++++
  247.  
  248. From: ely@norton.com (Dave Ely)
  249. Date: 22 Aug 92 02:47:24 GMT
  250. Organization: Symantec / Peter Norton
  251.  
  252. datpete@daimi.aau.dk (Peter Andersen) writes:
  253.  
  254.  > How do I make a (global) symbol known to MacsBug? I have tried
  255.  > adding 
  256.  > 
  257.  >    DC.B $8C, 'MySymbol' 
  258.  >    DC.W $0000 
  259.  > 
  260.  > after the last RTS in the code of the procedure, as described in the
  261.  > MacsBug manual (Appendix G, p.118, MacsBug version 6.1 manual), but
  262.  > the symbol is not known to MacsBug, when I try to debug the code. 
  263.  > 
  264.  > I am using MPW 3.2.2, System 7.0.1 (US), MacsBug version 6.2b2 on a
  265.  > Macintosh IIx.
  266.  
  267. You need something like this:
  268.  
  269.    DC.B $8C, 'MySymbol'
  270.    dc.b $0
  271.    DC.W $0000
  272.  
  273. The MacsBug symbol has to be padded to an even word length so that the
  274. data length offset (DC.W $0000) is on an even address. There is a
  275. macro which comes with the samples for for the MPW assembler which
  276. shows how to create MacsBug strings. I think it's called DbgStr.
  277.  
  278. - -- 
  279.  ______________________________________________________________
  280.     Dave Ely          \   Internet:  david_ely@qm.norton.com
  281.     Symantec Corp.     \             ely@norton.com
  282.     Peter Norton Group  \ AppleLink: Ely.D
  283.  
  284. +++++++++++++++++++++++++++
  285.  
  286. From: datpete@daimi.aau.dk (Peter Andersen)
  287. Date: 24 Aug 92 08:15:54 GMT
  288. Organization: DAIMI: Computer Science Department, Aarhus University, Denmark
  289.  
  290. In <1992Aug20.155733.6869@daimi.aau.dk> I wrote:
  291.  
  292. >How do I make a (global) symbol known to MacsBug?
  293. >I have tried adding 
  294.  
  295. >   DC.B $8C, 'MySymbol'
  296. >   DC.W $0000
  297.  
  298. >after the last RTS in the code of the procedure, as described in
  299. >the MacsBug manual (Appendix G, p.118, MacsBug version 6.1 manual),
  300. >but the symbol is not known to MacsBug, when I try to debug the code.
  301.  
  302. >I am using MPW 3.2.2, System 7.0.1 (US), MacsBug version 6.2b2 on a 
  303. >Macintosh IIx.
  304.  
  305. To sum up: The length byte should be $80 + <length of symbol>.
  306. Here it should have been $88.
  307.  
  308. HOWEVER, the MPW assembler has default STRING pascal, meaning that it
  309. inserts the length byte itself.
  310. Thus one should use $80 in the first byte, mening that the length is in
  311. next byte, and then let the assmbler calculate the length:
  312.  
  313.    DC.B $80, 'MySymbol'
  314.    DC.W $0000
  315.  
  316. This works for me.
  317. Someone also mentioned that the DC.W should be word aligned, meaning that
  318. a padding $0 should be inserted:
  319.  
  320.    DC.B $80, 'MySymbol'
  321.    DC.B $00
  322.    DC.W $0000
  323.  
  324. Peter Andersen
  325.  
  326. +++++++++++++++++++++++++++
  327.  
  328. From: REEKES@applelink.apple.com (Jim Reekes)
  329. Date: 24 Aug 92 19:22:58 GMT
  330. Organization: Apple Computer, Inc.
  331.  
  332. In article <1992Aug21.030941.6506@bilby.cs.uwa.edu.au>, quinn@cs.uwa.edu.au
  333. (Quinn) wrote:
  334. > In article <1992Aug20.155733.6869@daimi.aau.dk> Peter Andersen,
  335. > datpete@daimi.aau.dk writes:
  336. > >Am I missing something?
  337. > Hmm.  I had great fun getting MacsBug symbols working consistently
  338. > in my latest Asm project.  Try using the following macro (with
  339. > apologies to those people whose systems don't expand tabs
  340. > properly)...
  341. > ----------------------------------------------
  342. >     macro
  343. >     MacsBug    &Name,&rts:int
  344. >     lclc    &oldstr
  345. >     gbla    &debug
  346. >     if &debug then
  347. >     
  348. >     if &rts then 
  349. >     rts                ; force rts in specific cases
  350. >     endif
  351. >     
  352. >     dc.b    &len(&name)+$80        ; length of string + $80 marks symbol
  353. > &oldstr    setc    &setting('string')
  354. >     string    AsIs
  355. >     dc.b    '&upcase(&Name)'    ; define the string AsIs
  356. >     string    &oldstr
  357. >     align                ; pad to word boundary
  358. >     dc.w    0            ; no literals
  359. >     
  360. >     endif
  361. >     
  362. >     endm
  363. > ----------------------------------------------
  364.  
  365. Here's the macro I currently use.
  366.  
  367.  
  368.  
  369.    macro
  370.     symbol      &routineName=&SysMod,&size=0
  371.     lclc        &name, &oldString
  372.  
  373.     IF &TYPE('DEBUG') <> 'UNDEFINED' THEN
  374.         rts
  375.         if &routineName[1:1] = '''' then
  376.             &name: setc &eval(&routineName)
  377.         else
  378.             &name: setc &routineName
  379.         endif
  380.  
  381.         &oldString: setc &setting('string')
  382.         string asis
  383.         if &len(&name) < 32 then
  384.             dc.b &len(&name)+$80,'&name'
  385.         else
  386.             dc.b $80,&len(&name),'&name'
  387.         endif
  388.         string &oldString
  389.         align
  390.         dc.w &size
  391.     endif
  392.  
  393.     endm
  394.  
  395.  
  396. Just becareful where you add this.
  397.  
  398. It needs the RTS because sometimes you write Asm routines without a
  399. Link/Unlink.  The usage should be like this.
  400.  
  401. SomeRoutine   proc
  402.               ...
  403.               ...
  404.               ...
  405.               symbol "SomeRoutine"
  406.               endp
  407.  
  408.  
  409. - -----------------------------------------------------------------------
  410. Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
  411.                              |          Sound Manager Expert
  412. Apple Computer, Inc.         | RAll opinions expressed are mine, and do
  413. 20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
  414. Cupertino, CA 95014          |       employer, Apple Computer Inc.S
  415.  
  416. ---------------------------
  417.  
  418. From: kellys@orac.holonet.net (Kelly Schwarzhoff)
  419. Subject: # of files
  420. Date: 24 Aug 92 05:47:45 GMT
  421. Organization: HoloNet (BBS: 510-704-1058)
  422.  
  423. Does anyone know the maximum # of files that can exist in a folder/disk/
  424. computer (I'm interested in all 3)?  In addition, is there anything that
  425. will crash before this limit is hit so that there is a smaller practical
  426. limit (for example, if the operating system works with 2^32 files, but 
  427. Microsoft word crashes with more than 2^16 files).
  428.  
  429.  
  430. - -- 
  431. - -------------------------------------------------------------------------
  432. Kelly Schwarzhoff
  433. Internet: kellys@orac.holonet.net   Fidonet: 1:161/445.0
  434. - -------------------------------------------------------------------------
  435.  
  436. +++++++++++++++++++++++++++
  437.  
  438. From: probulf@Informatik.TU-Muenchen.DE (Frank Probul)
  439. Date: 24 Aug 92 11:14:56 GMT
  440. Organization: Technische Universitaet Muenchen, Germany
  441.  
  442.  
  443. In article <BtH43M.GvM@iat.holonet.net>, kellys@orac.holonet.net (Kelly Schwarzhoff) writes:
  444. |> Does anyone know the maximum # of files that can exist in a folder/disk/
  445. |> computer (I'm interested in all 3)?  In addition, is there anything that
  446. |> will crash before this limit is hit so that there is a smaller practical
  447. |> limit (for example, if the operating system works with 2^32 files, but 
  448. |> Microsoft word crashes with more than 2^16 files).
  449. |> 
  450. |> 
  451. There are some limits in the hierarchial file system:
  452. (The old file System "MFS" on system 3.2 and prior will not be discussed)
  453.  
  454. - --------------
  455. V O L U M E S :
  456. - --------------
  457. - - all these limits are for volumes and partitions. So if you have a 120 MB 
  458.   hard disk partitioned to 40 MB and 80 MB, it's the same as using
  459.   physically different HDs with 40 and 80 MB.
  460.  
  461. - - each volume is partitioned to a maximum of 2^16 = 65536 blocks.
  462.   The blocksize is a multiple of 512 Bytes.
  463.   The result: on a 30 MB-hard disk each block is 512 bytes, on larger volumes
  464.   the blocksize will be increased. On a 200 MB hard disk the blocksize will be
  465.   3.5 KBytes, on a CD-ROM or 650 MB hard disk the size is about 10 KBytes.
  466.  
  467. - - for each fork of a file a total block is used! If you put a 200 Bytes
  468.   TeachText document on a CD-ROM, it occupies 10 KBytes disk space.
  469.   (A MPW document has a resource fork AND a data fork, so 20 KBytes of
  470.   disk space are used)
  471.  
  472. - - The number of forks on a volume is thus limited to 2^16 = 65536.
  473.   (if each fork is smaller than the blocksize, 65536 files can be there).
  474.   Some files have only a data fork, some files have only a resource fork, 
  475.   some have both.
  476.  
  477. - - the max block size is 2^32 Bytes = 4 GigaBytes! The theoretical limit of
  478.   each partition is thus 256 TeraBytes. This is the suported size of the
  479.   File Manager.
  480.  
  481. - - There seems to be a bug in the calulating of sizes of the
  482.   Finder, so when using volumes larger than 2 GB some unusual results occur.
  483.   Sometimes the free space will be negative, or the finder won't copy files,
  484.   because of rounding errors. 
  485.       (If the hard disk is 4 GBytes and 50 KBytes, the 4 GigaBytes will be
  486.       rounded away resulting in a volume size of 50 kBytes. Now th Finder 
  487.       won't copy a 200 KBytes-File, because he thinks that there isn't
  488.       enough memory...)
  489.  
  490. - - There are some limits of the SCSI-protocol, but I don't know the exact values.
  491.  
  492. - - The max size of an AppleShare Volume
  493.   (AppleShare 2.0, 3.0 and Personal FileSharing) is limited to 4 GB.
  494.  
  495. - - The max size of an Novell file server mounted on Macs seems to be 2 GB.
  496.   The Novell-server can handle larger volumes, but the chooser extensions
  497.   won't mount such volumes.
  498.  
  499. - - The maximum number of files servers which are mounted at the same time
  500.   is limited by the machine type:
  501.   (here I'm not sure, the limits are documented in Inside Mac 5:File Manager)
  502.   Mac Plus: 3 Servers 
  503.   Mac SE: 8 Servers
  504.   other Macs: more...
  505.  
  506. - - The number of volumes mounted on each server is unlimited.
  507.  
  508. - - THE CONCLUSION:
  509.   1) Don't use partitions larger than 2 GBytes!
  510.   2) Partition your volumes if you don't want to waste disk space.
  511.  
  512. - ---------------
  513. F O L D E R S :
  514. - ---------------
  515. - - The max number of files in a folder is 32768 but the recommended limit
  516.   is about 1000 files, because opening such a volume takes a lot of time.
  517.   Perhaps there can be problems using the standard open/close-dialog because
  518.   the list manager data structure is limited to 32 KBytes. If buffering the 
  519.   file names with 30 characters each the limit will be reached when using 
  520.   about 1000 files.
  521.  
  522. - - The max number of items in the Apple Menu folder is limited to 32.000, but
  523.   only the alphabetically 52 first items will be displayed in the Apple Menu.
  524.  
  525. - -----------------
  526. M A C H I N E S :
  527. - -----------------
  528. _ the limits of machines are the limits of their volumes and folders.
  529.   The number of partitions is unlimited, but the number of open files is
  530.   limited. So if this limit is reaches, no more desktop files can be opened
  531.   an then thye volume can not be mounted.
  532.   I think System 7 handles the number of FCBs (File Control Blocks)
  533.   dynamically.
  534.  
  535.  
  536. Regarding you concerns about limitations caused by applications:
  537.   (:-Be careful using MicroSoft-Applications... :-)
  538.  
  539.  
  540.  
  541.  
  542. Frank Probul
  543. Emanuelstr. 17, D-8000 Munich 40, Germany
  544.  
  545. AppleLink: Probul.F
  546. internet:  probulf@informatik.tu-muenchen.de
  547.  
  548. Munich University of Technology
  549. Department of Computer Science
  550. Germany
  551. - ---------------------------------------------
  552.  
  553. +++++++++++++++++++++++++++
  554.  
  555. From: hcheng@Auspex.COM (Howard Cheng)
  556. Date: 25 Aug 92 00:33:07 GMT
  557. Organization: Auspex Systems, Santa Clara
  558.  
  559. In article <1992Aug24.111456.20439@Informatik.TU-Muenchen.DE> probulf@Informatik.TU-Muenchen.DE (Frank Probul) writes:
  560. >- There seems to be a bug in the calulating of sizes of the
  561. >  Finder, so when using volumes larger than 2 GB some unusual results occur.
  562. >  Sometimes the free space will be negative, or the finder won't copy files,
  563. >  because of rounding errors. 
  564. >      (If the hard disk is 4 GBytes and 50 KBytes, the 4 GigaBytes will be
  565. >      rounded away resulting in a volume size of 50 kBytes. Now th Finder 
  566. >      won't copy a 200 KBytes-File, because he thinks that there isn't
  567. >      enough memory...)
  568.  
  569. Actually, we just tried this a little while ago.  We made a VLP (Very Large
  570. Partition, > 4GB) on the UNIX server and then mounted that volume onto the
  571. desktop using NFS/Share (v. 1.1.2) and the Mac was able to read the correct
  572. size of the volume (some ungodly large number).  Other information: Mac IIci,
  573. System 7.0.1, Tuner 1.1.1.
  574.  
  575. Howard
  576.  
  577.  
  578. +++++++++++++++++++++++++++
  579.  
  580. From: kellys@orac.holonet.net (Kelly Schwarzhoff)
  581. Organization: HoloNet (BBS: 510-704-1058)
  582. Date: Wed, 26 Aug 1992 17:56:01 GMT
  583.  
  584. > - each volume is partitioned to a maximum of 2^16 = 65536 blocks. 
  585. >   The blocksize is a multiple of 512 Bytes. 
  586. >   The result: on a 30 MB-hard disk each block is 512 bytes, on larger
  587. > volumes 
  588. >   the blocksize will be increased. On a 200 MB hard disk the
  589. > blocksize will be 
  590. >   3.5 KBytes, on a CD-ROM or 650 MB hard disk the size is about 10
  591. > KBytes.
  592.  
  593. Is there anyway to get around this limit? I have a 600MB drive and have it
  594. formatted so that each block is 10k and can't find a way to have smaller
  595. blocks.  Is the limit of 2^16 due to the operating software or just the
  596. software that formats the drive.
  597.  
  598. The reason I'm asking this is that we're setting up a large FirstClass BBS
  599. software and it stores every message as a file and you cannot have the
  600. messages in seperate volumes / partitions.  I'm running System 7.0 on a IIfx.
  601.  
  602.  
  603. - -- 
  604. - -------------------------------------------------------------------------
  605. Kelly Schwarzhoff
  606. Internet: kellys@orac.holonet.net   Fidonet: 1:161/445.0
  607. - -------------------------------------------------------------------------
  608.  
  609. +++++++++++++++++++++++++++
  610.  
  611. From: keith@taligent.com (Keith Rollin)
  612. Organization: Taligent
  613. Date: Wed, 26 Aug 1992 20:18:19 GMT
  614.  
  615. In article <BtLr5D.Hy7@iat.holonet.net>, kellys@orac.holonet.net (Kelly
  616. Schwarzhoff) writes:
  617. > > - each volume is partitioned to a maximum of 2^16 = 65536 blocks. 
  618. > >   The blocksize is a multiple of 512 Bytes. 
  619. > >   The result: on a 30 MB-hard disk each block is 512 bytes, on larger
  620. > > volumes 
  621. > >   the blocksize will be increased. On a 200 MB hard disk the
  622. > > blocksize will be 
  623. > >   3.5 KBytes, on a CD-ROM or 650 MB hard disk the size is about 10
  624. > > KBytes.
  625. > Is there anyway to get around this limit? I have a 600MB drive and have it
  626. > formatted so that each block is 10k and can't find a way to have smaller
  627. > blocks.  Is the limit of 2^16 due to the operating software or just the
  628. > software that formats the drive.
  629. > The reason I'm asking this is that we're setting up a large FirstClass BBS
  630. > software and it stores every message as a file and you cannot have the
  631. > messages in seperate volumes / partitions.  I'm running System 7.0 on a IIfx.
  632.  
  633. The limit of 2^16 allocation blocks is due to the HFS format. All the data
  634. structures used to keep track of where files are located on the volume use
  635. 2-byte values for the block number.
  636.  
  637. The only way to get more room from your 600MB drive is to partition it into two
  638. or more smaller logical volumes. Or rewrite the File Manager.
  639.  
  640. - --
  641. Keith Rollin
  642. Phantom Programmer
  643. Taligent, Inc.
  644.  
  645.  
  646. +++++++++++++++++++++++++++
  647.  
  648. From: york@oakland-hills.lucid.com (Bill York)
  649. Date: 26 Aug 92 21:02:43 GMT
  650. Organization: Lucid, Inc.
  651.  
  652. In article <BtLr5D.Hy7@iat.holonet.net> kellys@orac.holonet.net (Kelly Schwarzhoff) writes:
  653.  
  654.    From: kellys@orac.holonet.net (Kelly Schwarzhoff)
  655.  
  656.    Is there anyway to get around this limit? I have a 600MB drive and have it
  657.    formatted so that each block is 10k and can't find a way to have smaller
  658.    blocks.  Is the limit of 2^16 due to the operating software or just the
  659.    software that formats the drive.
  660.  
  661.    The reason I'm asking this is that we're setting up a large FirstClass BBS
  662.    software and it stores every message as a file and you cannot have the
  663.    messages in seperate volumes / partitions.  I'm running System 7.0 on a IIfx.
  664.  
  665. Can the software store messages in sub-folders of the main
  666. message-area folder?  You could then make these sub-folders be aliases
  667. pointing to folders on different partitions.  Or does the BBS software
  668. circumvent your access to the filesystem completely?
  669.  
  670. +++++++++++++++++++++++++++
  671.  
  672. From: mlanett@Apple.COM (Mark Lanett)
  673. Date: 27 Aug 92 04:16:19 GMT
  674. Organization: Apple Computer Inc., Cupertino, CA
  675.  
  676. kellys@orac.holonet.net (Kelly Schwarzhoff) writes:
  677.  
  678. >Is there anyway to get around this limit? I have a 600MB drive and have it
  679. >formatted so that each block is 10k and can't find a way to have smaller
  680. >blocks.  Is the limit of 2^16 due to the operating software or just the
  681. >software that formats the drive.
  682.  
  683. >The reason I'm asking this is that we're setting up a large FirstClass BBS
  684. >software and it stores every message as a file and you cannot have the
  685. >messages in seperate volumes / partitions.  I'm running System 7.0 on a IIfx.
  686.  
  687. Not that I'm aware of, but you can always partition the drive anyway and stick
  688. the non-messages on the other partition. That should drop it to 5K or so.
  689. - -- 
  690. Have a bajillion brilliant Jobsian lithium licks.
  691. Mark Lanett, NOT speaking for anyone. Personal opinion only.
  692.  
  693. +++++++++++++++++++++++++++
  694.  
  695. From: kent@sunfs3.Camex.COM (Kent Borg)
  696. Date: 27 Aug 92 18:38:19 GMT
  697. Organization: Camex Inc., Boston MA
  698.  
  699. In article <YORK.92Aug26160243@oakland-hills.lucid.com> York@Lucid.COM writes:
  700. >In article <BtLr5D.Hy7@iat.holonet.net> kellys@orac.holonet.net (Kelly Schwarzhoff) writes:
  701. >
  702. >   From: kellys@orac.holonet.net (Kelly Schwarzhoff)
  703. >
  704. >   Is there anyway to get around this limit? I have a 600MB drive and have it
  705. >   formatted so that each block is 10k and can't find a way to have smaller
  706. >   blocks.  Is the limit of 2^16 due to the operating software or just the
  707. >   software that formats the drive.
  708. >
  709. >   The reason I'm asking this is that we're setting up a large FirstClass BBS
  710. >   software and it stores every message as a file and you cannot have the
  711. >   messages in seperate volumes / partitions.  I'm running System 7.0 on a IIfx.
  712. >
  713. >Can the software store messages in sub-folders of the main
  714. >message-area folder?  You could then make these sub-folders be aliases
  715. >pointing to folders on different partitions.  Or does the BBS software
  716. >circumvent your access to the filesystem completely?
  717. >
  718.  
  719.  
  720. The 2^16 limit is an HFS limit.
  721.  
  722. No, Firstclass does not circumvent the file system, aliases are not
  723. implemented by the file system--which is what annoys the makers of
  724. Firstclass.  I think they wish they were on a Unix box.  To use
  725. aliases would require extra irksome work on their part.
  726.  
  727. As a result Firstclass does not know about aliases and isn't likely to
  728. soon--at least judging from a phone conversation I once had with
  729. someone fairly technical there.  It seems that they are getting burned
  730. by the Mac's lack of preemptive multitasking and generally starting to
  731. fight with their server platform choice, not cooperate with it.  I am
  732. worried.  (Notice sometime how the server's screen--1.0 at least--can
  733. get painted and scroll *while* a menu is down.  Horrors.)
  734.  
  735. Disclaimer: I have not yet installed Firstclass version 2, my only
  736. experiance is with the first version.
  737.  
  738. As for how to make partitioning choices, put your system folder and
  739. any non-FirstClass stuff on a small partition (or separate disk) and
  740. give the the Firstclass database (I think just the "FirstClass Post
  741. Office" folder) as much space as you can.  Your limit is likely going
  742. to be the 64K-blocks wall.  A big allocation size will keep the larger
  743. files from gobbling up so many of those blocks.  Yes, seeing 10K
  744. vanish with each little message hurts, but total bytes is not the
  745. first limit you are going to hit with a little-file-laden BBS on a big
  746. disk.  Yes, using two 300 Meg partitions would get you farther, but
  747. only if you are allowed.  A 600 partition is always going to hold at
  748. least as much as a 300--and usually far more.
  749.  
  750. Weasel Words: I am sure I have the term "allocation size" slightly
  751. wrong, but it shouldn't demolish my underlying points.
  752.  
  753. Coward's Words: Please be gentle when it does become obvious that I
  754. have no valid underlying points.
  755.  
  756.  
  757. - --
  758. Kent Borg                                   kent@camex.com or kentborg@aol.com
  759.                                             H:(617) 776-6899  W:(617) 426-3577
  760. As always, things look better when some costs are left out.
  761.                               -Economist 3-28-92 p. 94
  762.  
  763. +++++++++++++++++++++++++++
  764.  
  765. From: sdorner@qualcom.qualcomm.com (Steve Dorner)
  766. Date: 27 Aug 92 22:07:40 GMT
  767. Organization: Qualcomm, Inc., San Diego, CA
  768.  
  769. kent@sunfs3.Camex.COM (Kent Borg) writes:
  770. >No, Firstclass does not circumvent the file system, aliases are not
  771. >implemented by the file system--which is what annoys the makers of
  772. >Firstclass.  I think they wish they were on a Unix box.  To use
  773. >aliases would require extra irksome work on their part.
  774.  
  775. Sounds like they have an Attitude.  Of course, they're not the
  776. only ones.  I can think of one particular development system that ALSO
  777. doesn't have a clue about aliases.  It's called MPW, and the company
  778. is some fruit name.  Ah, well, they probably weren't Apple Partners, and
  779. didn't get any warning of what was going to happen in System 7. :-)
  780.  
  781. Aliases are implemented in an unpleasant way for any app that doesn't
  782. just use standard file, and it's no particular shame that aliases
  783. aren't supported in such apps.  Of course, as the years wear on, one's
  784. patience wears thinner.
  785. - -- 
  786. Steve Dorner, Qualcomm, Inc.
  787. Yes, I'm still working on Eudora and it's still free.
  788.  
  789. ---------------------------
  790.  
  791. From: morris@quake.think.com (Harry Morris)
  792. Subject: more on sublaunching
  793. Date: 15 Sep 92 16:59:55
  794. Organization: Thinking Machines Corporation, Cambridge MA, USA
  795.  
  796.  
  797. thanks to everyone who sent suggestion son sub-lanuching.  I think I've
  798. gotten sub-launching pretty much working now!
  799.  
  800. However, I've got a document I need to launch, I know it's name, type, and
  801. creator.  I've set up the AppParmHandle to point to my file, and that works
  802. fine.  Two problems remain though.  I'd appreciate any help I can get.
  803.  
  804. 1) I need to figure out which app to launch, given a type and creator.
  805. This is probably normally done by the finder.  I think the necessary info
  806. is in the desktop file, but TN 29 says not to rely on that.  Is there any
  807. kosher way to do this?
  808.  
  809. 2) When I launch an app (say, MSWord) with a doc, it opens the doc, and
  810. becomes the frontmost app.  But then if I switch back to my app, and try to
  811. launch another doc in the same app, the app becomes frontmost, but the
  812. second do is not loaded.  Any idea how do this?  I've seen OnLocation do
  813. it. 
  814.  
  815. +++++++++++++++++++++++++++
  816.  
  817. From: sorchard@crowded-house.den.mmc.com (Steve Orchard)
  818. Date: 16 Sep 92 13:37:20 GMT
  819. Organization: Martin Marietta
  820.  
  821. In article <MORRIS.92Sep15165955@quake.think.com>, morris@quake.think.com (Harry Morris) writes:
  822. > 1) I need to figure out which app to launch, given a type and creator.
  823. > This is probably normally done by the finder.  I think the necessary info
  824. > is in the desktop file, but TN 29 says not to rely on that.  Is there any
  825. > kosher way to do this?
  826.  
  827. To do this open the resource fork of the deskTop file, then load the APPL 
  828. resource.  After that then search for the creator, once the creator is found
  829. it tells you the applications name and Dir ID.  You can use this information to
  830. launch the appliction.  If system 7 is running then you should use AppleEvents
  831. to send the finder a open doc message.
  832.  
  833. > 2) When I launch an app (say, MSWord) with a doc, it opens the doc, and
  834. > becomes the frontmost app.  But then if I switch back to my app, and try to
  835. > launch another doc in the same app, the app becomes frontmost, but the
  836. > second do is not loaded.  Any idea how do this?  I've seen OnLocation do
  837. > it. 
  838.  
  839. This is harder what the finder does is fakes a menu hit in the open... under
  840. the file menu, then it bypasses the file picker.  If you use AppleEvents under
  841. system 7 you won't have this problem.
  842.  
  843. Good Luck
  844. Steve Orchard
  845. sorchard@crowded-house.den.mmc.com
  846.  
  847.  
  848. +++++++++++++++++++++++++++
  849.  
  850. From: grobbins@Apple.COM (Grobbins)
  851. Date: 17 Sep 92 05:44:58 GMT
  852. Organization: Apple Computer Inc., Cupertino, CA
  853.  
  854. In article <1992Sep16.133720.12774@den.mmc.com> sorchard@crowded-house.den.mmc.com (Steve Orchard) writes:
  855. >In article <MORRIS.92Sep15165955@quake.think.com>, morris@quake.think.com (Harry Morris) writes:
  856. >> 1) I need to figure out which app to launch, given a type and creator.
  857. >> This is probably normally done by the finder.  I think the necessary info
  858. >> is in the desktop file, but TN 29 says not to rely on that.  Is there any
  859. >> kosher way to do this?
  860. >To do this open the resource fork of the deskTop file, then load the APPL 
  861. >resource.  After that then search for the creator, once the creator is found
  862. >it tells you the applications name and Dir ID.  You can use this information to
  863. >launch the appliction.  If system 7 is running then you should use AppleEvents
  864. >to send the finder a open doc message.
  865.  
  866. Opening the resource fork of the desktop file is a bad idea since
  867. the resource map may not be accurate.  
  868.  
  869. Sending an "open doc" event to the Finder doesn't do anything; you can
  870. send an Open Selection Finder event, though the current Finder does not
  871. give any feedback to indicate whether the event succeeded, so this is
  872. not a great approach.
  873.  
  874. Under System 6, there is no good, documented, reliable way to find
  875. the creator of a document short of searching the disk.  Under System 7,
  876. the Desktop Manager makes it easy.  Pasted below is some code which
  877. shows both the "safe" (Desktop Manager) and "unsafe" (Desktop file)
  878. ways of finding the application for a document.
  879.  
  880. Launching an application should be done by calling LaunchApplication
  881. (shown in the Process Management chapter of Inside Mac VI, or by
  882. calling _Launch under System 6, as documented in the Sublaunch Tech Note.)
  883. To open a document with an application, pass LaunchApplication a coerced
  884. 'odoc' event in the appParameters field; see the snippet "LaunchWithDoc"
  885. (available at ftp.apple.com) for an example.
  886.  
  887. >> 2) When I launch an app (say, MSWord) with a doc, it opens the doc, and
  888. >> becomes the frontmost app.  But then if I switch back to my app, and try to
  889. >> launch another doc in the same app, the app becomes frontmost, but the
  890. >> second do is not loaded.  
  891. >This is harder what the finder does is fakes a menu hit in the open... under
  892. >the file menu, then it bypasses the file picker.  If you use AppleEvents under
  893. >system 7 you won't have this problem.
  894.  
  895. Under System 7, the system will pull "puppet strings" for you by
  896. simulating an Open menu selection if your application sends an 'odoc'
  897. event but the target is not high-level event aware.  So go ahead and
  898. send 'odoc's to everyone (except when launching; then, coerce the
  899. odoc and include it with the LaunchApplication call.)
  900.  
  901. Grobbins         grobbins@apple.com
  902.  
  903. Usual disclaimers apply.
  904.  
  905. - ---
  906.  
  907.  
  908.   FUNCTION FindAppFromDoc(docFSSpec: FSSpec; VAR appFSSpec: FSSpec): OSErr;
  909.   { first find an app on the same volume; next try local volumes; 
  910.     next try remote volumes }
  911.     
  912.   { to find applications on volumes without a Desktop Database, we rely on
  913.     the Desktop file.  This is bad, bad, as explained below. }
  914.     
  915.   LABEL 1;
  916.   TYPE
  917.     volumePass = (document, local, remote, done);
  918.  
  919.     { record in APPL resource of Desktop file }
  920.     APPLTypePtr = ^APPLType;
  921.     APPLType = RECORD
  922.                    creator: OSType;
  923.                    dirID: LongInt;
  924.                    name: Str63;    { actually, name size is variable }
  925.                  END;
  926.   VAR
  927.     myDTPBRec: DTPBRec;
  928.     docFInfo, dummyFInfo: FInfo;
  929.     retCode: OSErr;
  930.     theVolumePass: volumePass;
  931.     theVolumeCounter: INTEGER;
  932.     
  933.     myHParamBlockRec: HParamBlockRec;
  934.     myGetVolParmsInfoBuffer: GetVolParmsInfoBuffer;
  935.     remoteFlag, foundFlag: BOOLEAN;
  936.     
  937.     resRefNum: INTEGER;
  938.     resHandle: Handle;
  939.     theAPPLType: APPLType;
  940.     theAPPLTypePtr: APPLTypePtr;
  941.     offset: LONGINT;
  942.   BEGIN
  943.   
  944.     theVolumePass := document;
  945.     foundFlag := FALSE;
  946.     
  947.     retCode := FSpGetFInfo(docFSSpec, docFInfo);
  948.     IF retCode <> noErr THEN GOTO 1;
  949.  
  950.     REPEAT  { for each kind of pass }
  951.     
  952.       theVolumeCounter := 0;
  953.       
  954.       REPEAT  { for each volume, except on first pass }
  955.       
  956.         { first, find the vRefNum of the volume to be checked }
  957.         
  958.         IF theVolumePass = document THEN { use doc's own volume }
  959.           myDTPBRec.ioVRefNum := docFSSpec.vRefNum
  960.         ELSE
  961.           BEGIN
  962.             theVolumeCounter := theVolumeCounter + 1;
  963.             
  964.             { loop through all drives }
  965.             myHParamBlockRec.ioCompletion := NIL;
  966.             myHParamBlockRec.ioNamePtr := NIL;
  967.             myHParamBlockRec.ioVRefNum := 0;
  968.             myHParamBlockRec.ioVolIndex := theVolumeCounter;
  969.             retCode := PBHGetVInfoSync(@myHParamBlockRec);
  970.             
  971.             IF retCode = nsvErr THEN Leave; { checked all drives }
  972.             IF retCode <> noErr THEN GOTO 1;
  973.             
  974.             { is this one remote? }
  975.             myHParamBlockRec.ioBuffer := @myGetVolParmsInfoBuffer;
  976.             myHParamBlockRec.ioReqCount :=
  977.  
  978.               Sizeof(myGetVolParmsInfoBuffer);
  979.             retCode := PBHGetVolParmsSync(@myHParamBlockRec);
  980.             IF (retCode <> noErr) THEN GOTO 1;
  981.             
  982.             { volume should be remote only on remote pass, else skip it }
  983.             IF (myGetVolParmsInfoBuffer.vMServerAdr <> 0)
  984.               <> (theVolumePass = remote) THEN Cycle;
  985.             
  986.             { found a volume of interest }
  987.             myDTPBRec.ioVRefNum := myHParamBlockRec.ioVRefNum;
  988.             
  989.           END; { ELSE }
  990.           
  991.         myDTPBRec.ioNamePtr := NIL;
  992.         
  993.         { Get the application name and directory from the desktop database, if
  994.           the volume has one.  Otherwise, check the desktop file. }
  995.          
  996.         retCode := PBDTGetPath(@myDTPBRec);
  997.         IF (retCode = noErr) AND (myDTPBRec.ioResult = noErr) AND
  998.           (myDTPBRec.ioDTRefNum <> 0) THEN
  999.           BEGIN
  1000.             { get application name and directory }
  1001.             myDTPBRec.ioNamePtr := @appFSSpec.name; { change the file spec name}
  1002.             myDTPBRec.ioIndex := 0;
  1003.             myDTPBRec.ioFileCreator := docFInfo.fdCreator;
  1004.             myDTPBRec.ioCompletion := NIL;
  1005.         
  1006.             retCode := PBDTGetAPPLSync(@myDTPBRec);
  1007.             IF retCode = noErr THEN 
  1008.               BEGIN
  1009.                 appFSSpec.parID := myDTPBRec.ioAPPLParID;
  1010.                 appFSSpec.vRefNum := myDTPBRec.ioVRefNum;
  1011.                 foundFlag := TRUE;
  1012.               END;
  1013.           END
  1014.         ELSE  
  1015.           { check Desktop file if there is one on the volume }
  1016.           { WARNING:  this next section is a bad idea; leave
  1017.             it out unless you absolutely have to find the
  1018.             application.  The steps shown are officially
  1019.             undocumented and discouraged.   }
  1020.             
  1021.           { This is risky, because the Desktop file is
  1022.             probably already open with write priveleges by
  1023.             the Finder, and the Macintosh OS does not guarantee
  1024.             that the resource map is valid }
  1025.             
  1026.           BEGIN
  1027.           
  1028.             { root directory's dirID is always 2 }
  1029.             { application directory info is kept in APPL resource }
  1030.             { HOpenResFile with read permission should give a unique
  1031.               resource reference number, making it safe to call
  1032.               CloseResFile later. }
  1033.               
  1034.             resRefNum := HOpenResFile(myDTPBRec.ioVRefNum, 2,
  1035.               'Desktop', fsRdPerm);
  1036.             retCode := ResError;
  1037.             IF retCode = noErr THEN
  1038.               BEGIN
  1039.                 resHandle := Get1IndResource('APPL', 1);
  1040.                 retCode := ResError;
  1041.                 
  1042.                 IF (retCode = noErr) AND (resHandle <> NIL) THEN
  1043.                 { just checking resHandle <> NIL is enough }
  1044.                   BEGIN
  1045.                     HLock(resHandle);
  1046.                     offset := 0;
  1047.                     
  1048.                     { loop through all application information in the APPL }
  1049.                     
  1050.                     WHILE (offset < SizeResource(resHandle)) AND NOT foundFlag
  1051.                       DO
  1052.                       BEGIN
  1053.                         theAPPLTypePtr :=
  1054.                            APPLTypePtr(Pointer(offset+ORD4(resHandle^)));
  1055.                         theAPPLType := theAPPLTypePtr^;
  1056.     
  1057.                         IF (theAPPLType.creator = docFInfo.fdCreator) AND
  1058.                           { desktop database sometimes points to phantom apps }
  1059.                           (HGetFInfo(myDTPBRec.ioVRefNum, theAPPLType.dirID,
  1060.                             theAPPLType.name,
  1061.                             dummyFInfo) = noErr) THEN { a file really is there }
  1062.                           BEGIN
  1063.                             { found the app }
  1064.                             appFSSpec.parID := theAPPLType.dirID;
  1065.                             appFSSpec.vRefNum := myDTPBRec.ioVRefNum;
  1066.                             appFSSpec.name := theAPPLType.name;
  1067.                             { really should call FSMakeFSSpec instead }
  1068.                             foundFlag := TRUE;
  1069.                           END;
  1070.                         { to find next, skip over creator code, dirID, name, 
  1071.                           pad byte }
  1072.                         offset := offset + 4 + 4 + 1 + Length(theAPPLType.name);
  1073.                         
  1074.                         { of course, MPW Pascal compiles this down to
  1075.                           ADDQ.L     #$4,D0
  1076.                           ADDQ.L     #$4,D0
  1077.                           ADDQ.L     #$1,D0
  1078.                           CLR.W      D1
  1079.                           MOVE.B     -$01AA(A6),D1
  1080.                           EXT.L      D1
  1081.                           MOVE.L     D1,D4
  1082.                           ADD.L      D0,D4                            }
  1083.                         
  1084.                         IF (offset MOD 2) = 1 THEN offset := offset + 1;
  1085.                       END; { WHILE }
  1086.                     HUnlock(resHandle);
  1087.                     
  1088.                     CloseResFile(resRefNum);
  1089.                   END; { IF }
  1090.               END; { IF }
  1091.           END; { ELSE }
  1092.         
  1093.       UNTIL foundFlag OR (theVolumePass = document);
  1094.         { OR ran out of drives, due to Leave statement }
  1095.       
  1096.       theVolumePass := SUCC(theVolumePass)
  1097.       
  1098.     UNTIL foundFlag OR (theVolumePass = done);
  1099.     
  1100.     IF NOT foundFlag THEN retCode := fnfErr;
  1101.   1:
  1102.     FindAppFromDoc := retCode;
  1103.   END;
  1104.   
  1105.  
  1106. ---------------------------
  1107.  
  1108. From: George.Economou@p4.f120.n129.z1.FIDONET.ORG (George Economou)
  1109. Subject: animating palettes
  1110. Date: 29 Aug 92 02:45:20 GMT
  1111. Organization: FidoNet node 1:129/120.4 - Mac For The Mind, Pittsburgh PA
  1112.  
  1113. I am trying to animate a palette but a few colors refuse to animate.  How can
  1114. I make it so that all colors animate?
  1115. - --  
  1116. George Economou via cmhGate - Net 226 fido<=>uucp gateway Col, OH
  1117. UUCP: ...!n8emr!bluemoon!cmhgate!129!120.4!George.Economou
  1118. INET: George.Economou@p4.f120.n129.z1.FIDONET.ORG
  1119.  
  1120. +++++++++++++++++++++++++++
  1121.  
  1122. From: johnsd2@vccnw05.its.rpi.edu (Daniel Norman Johnson)
  1123. Organization: Rensselaer Polytechnic Institute, Troy, NY.
  1124. Date: Thu, 3 Sep 1992 12:17:26 GMT
  1125.  
  1126. In article <966857.2AA30874@cmhgate.fidonet.org>, George.Economou@p4.f120.n129.z1.FIDONET.ORG (George Economou) writes:
  1127. |> I am trying to animate a palette but a few colors refuse to animate.  How can
  1128. |> I make it so that all colors animate?
  1129.  
  1130. Are the colors that wont animate Black and White? If not, I have no clue
  1131. what is wrong. If so, the Palette Manager does that on purpose (so
  1132. windows, menus, etc can be drawn) and you should probably let it do so. If
  1133. you just gotta change those colors, I expect the Color Manager can do it,
  1134. but I dont have details. (I have never tried to do this)
  1135. - -- 
  1136.             - Dan Johnson
  1137. And God said "Jeeze, this is dull"... and it *WAS* dull. Genesis 0:0
  1138.  
  1139. These opinions have had all identifiying marks removed, and are untraceable.
  1140. You'll never know whose they are.
  1141.  
  1142. +++++++++++++++++++++++++++
  1143.  
  1144. From: George.Economou@p4.f120.n129.z1.FIDONET.ORG (George Economou)
  1145. Date: 14 Sep 92 00:13:50 GMT
  1146. Organization: FidoNet node 1:129/120.4 - Mac For The Mind, Pittsburgh PA
  1147.  
  1148. >We need more to go on than this.  What colors aren't animating?  Some
  1149. >code would be helpful.
  1150. >
  1151. >If you want to animate the first and last color in the color table,
  1152. >black and white...well, you just can't do it with the Palette Manager.
  1153. >You'll have to use the Color Manager instead (though I recommend a long
  1154. >hard think before deciding to do this).
  1155.  
  1156. I have no troubles dealing with the black and white (I don't use them for the
  1157. drawing).  What I am doing, is first getting a palette from a resource and
  1158. assigning it to a windowptr with SetPalette().  Two questions: what would the
  1159. ideal usage be, pmanimated or pmanimated+pmtolerant? and should I set the
  1160. cupdates field of SetPalette() to true or false?
  1161. I then call Activatepalette() for the windowptr.
  1162. Then, I draw into an offscreen pixmap with the same palette SetPalette()'ed to
  1163. it using rgbforecolor, not pmforecolor (I abandoned pmforecolor 'cause I
  1164. thought it might be a problem cause and I can do better effects without it). 
  1165. Then I copybits() it to the windowptr previously mentioned and it works.  Then
  1166. I call animatepalette() and only about half of the colors animate, the other
  1167. half just sitting there doing nothing.  It is the same colors every time, and
  1168. they are a few reds and a few greens, mixed in with all the others. :P  
  1169.  
  1170. Hope that helps.... thanks for helping out!  
  1171. *8)
  1172. - -G     e    o   r  g eE c  o   n    o     m      o       u
  1173. :):):):)
  1174.  
  1175. - --  
  1176. George Economou via cmhGate - Net 226 fido<=>uucp gateway Col, OH
  1177. UUCP: ...!n8emr!bluemoon!cmhgate!129!120.4!George.Economou
  1178. INET: George.Economou@p4.f120.n129.z1.FIDONET.ORG
  1179.  
  1180. +++++++++++++++++++++++++++
  1181.  
  1182. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  1183. Date: 16 Sep 92 21:40:11 GMT
  1184. Organization: Kalamazoo College
  1185.  
  1186. George.Economou@p4.f120.n129.z1.FIDONET.ORG (George Economou) writes:
  1187. >What I am doing, is first getting a palette from a resource and
  1188. >assigning it to a windowptr with SetPalette().  Two questions: what would the
  1189. >ideal usage be, pmanimated or pmanimated+pmtolerant? and should I set the
  1190. >cupdates field of SetPalette() to true or false?
  1191.  
  1192. Well, since there's no such usage category as pmAnimated+pmTolerant, I
  1193. guess that narrows it down.  :-)  pmAnimated will do you just fine;
  1194. there wouldn't be any point to making it tolerant or courteous, since
  1195. that only matters when two windows share a palette entry, and pmAnimated
  1196. colors are never shared between windows.
  1197.  
  1198. And the updates field should be TRUE, generally speaking.  If you pass
  1199. FALSE, you'll never get update events when the color environment
  1200. changes--for example, when your app goes into the background and you
  1201. lose all those nice pmAnimated colors.  (You might pass FALSE if your
  1202. app will never be backgrounded, or, say, if you're the ViewColors DA,
  1203. which just draws the color environment pmExplicitly anyway.  But
  1204. generally, pass TRUE.)
  1205.  
  1206. >I then call Activatepalette() for the windowptr.
  1207.  
  1208. That's unnecessary;  SetPalette() takes care of that for you.  (I don't
  1209. think it messes anything up, but I could be wrong.  Anyone else know?)
  1210.  
  1211. >Then, I draw into an offscreen pixmap with the same palette SetPalette()'ed to
  1212. >it using rgbforecolor, not pmforecolor (I abandoned pmforecolor 'cause I
  1213. >thought it might be a problem cause and I can do better effects without it). 
  1214.  
  1215. OK.  In the Winter 92 develop, Forrest Tanaka has a little 2-page
  1216. article about the Palette Manager and off-screen pixmaps, in which he
  1217. explains that pmCourteous, pmWhite, and pmBlack usages work, but that
  1218. pmTolerant, pmAnimated, and pmExplicit do not.
  1219.  
  1220. I'm not sure what it would mean to SetPalette() a palette to a pixmap.
  1221. I'm presuming you have indeed set up your offscreen CGrafPort properly,
  1222. and you're passing its pointer to SetPalette().
  1223.  
  1224. RGBForeColor will, I believe, assign the color index based on the
  1225. current _GDevice_, so that should work if your window's already been
  1226. created, because the color environment on the _screen_ is the same as
  1227. the one offscreen.  But this will fail if things get iffy;  for example,
  1228. if your window isn't frontmost at the time.
  1229.  
  1230. >Then I copybits() it to the windowptr previously mentioned and it works.
  1231.  
  1232. Two possibilities here;  which one is the case, depends on how you made
  1233. your offscreen pixmap.  Either (1) its color table's seed is identical
  1234. to the screen's, and CopyBits is blindly putting the colors up, or (2)
  1235. the seeds are different, and CopyBits, doggedly refusing to use those
  1236. pmAnimated colors, is instead giving you very close matches to the
  1237. colors you want, so close that you don't immediately notice.
  1238.  
  1239. (Or, (3), you've already done what I'm about to say, and just didn't
  1240. mention it.  :-)
  1241.  
  1242. There's two ways to CopyBits an offscreen pixmap into pmAnimated colors:
  1243. the fast, not-so-easy way, and the slow, a-little-easier way.
  1244.  
  1245. The fast way is (1) above:  make _sure_ your offscreen color table and
  1246. the onscreen color table agree about the important colors.  Then, set
  1247. your offscreen pixmap's color table's ctSeed value to the screen's
  1248. pixmap's color table's ctSeed, and blast those bits to the screen.
  1249. CopyBits, when it sees equal seeds, just copies the pixels.  This is a
  1250. little harder if you want to draw in the offscreen pixmap, because
  1251. normal QuickDraw commands don't care whether the destination ctSeed is
  1252. equal to the screen's (in fact, aren't even aware of the screen at all).
  1253.  
  1254. The slow way is to set bit 14 of your offscreen pixmap's color table,
  1255. and set all the ColorSpec.value entries to the _palette_ entries you
  1256. want.  CopyBits will, for each source pixel, look its value up in the
  1257. table, convert that palette entry to a clut entry, and write that to the
  1258. screen.  It's probably two or three times slower (I've never tested it).
  1259. But it's easier, if you're using QuickDraw to go offscreen, because
  1260. there's none of this chicanery with ctSeeds...
  1261.  
  1262. >Then
  1263. >I call animatepalette() and only about half of the colors animate, the other
  1264. >half just sitting there doing nothing.
  1265.  
  1266. Hmmm.  Strange behavior.  You've stumped me.  :-)  If I had to guess,
  1267. I'd say the seeds were equal, and the P.M. had coincidentally given half
  1268. the colors the same clut index as palette index, so that only these were
  1269. animating...
  1270. - -- 
  1271.  Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
  1272.  Memo to myself:
  1273.  Do The Dumb Things I Gotta Do.
  1274.  Touch The Puppet Head.
  1275.  
  1276. ---------------------------
  1277.  
  1278. End of C.S.M.P. Digest
  1279. **********************
  1280.